package practice2;

import java.util.Scanner;

public class P8615 {

    //判断一个数是不是平方数
    public static boolean isSquare(int num){
        if(num == 0){
            return false;
        }
        int ans = (int) Math.sqrt(num);
        if(ans * ans == num){
            return true;
        }else{
            return false;
        }
    }


    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        for(int i=a;i<=b;i++){
            if(!isSquare(i)){
                continue;
            }
            String str = Integer.toString(i);
            for(int j=1;j<str.length();j++){
                int n1 = Integer.parseInt(str.substring(0, j));
                if(isSquare(n1)){
                    int n2 = Integer.parseInt(str.substring(j,str.length()));
                    if(isSquare(n2)){
                        System.out.println(str);
                    }
                }
            }
        }

    }
}
